<extend name="Public/base"/>

<block name="sidebar"></block>

<block name="style">
<script type="text/javascript" src="__JS__/Chart.min.js"></script>
    <style>
        body{padding: 0}
    </style>
</block>

<block name="body">
    <!-- 主体 -->
    <div id="indexMain" class="index-main">
       <!-- 插件块 -->
       <div class="container-span">{:hook('AdminIndex')}</div>
    </div>
       <div id="charts-div">
            <canvas id="canv_orders" height="100" width="200"></canvas>
       </div>
</block>

<block name="script">
<script type="text/javascript">
    var randomScalingFactor = function(){ return Math.round(Math.random()*100)};

    var barChartData = {
        labels : ["January","February","March","April","May","June","July"],
        datasets : [
            {
                fillColor : "rgba(220,220,220,0.5)",
                strokeColor : "rgba(220,220,220,0.8)",
                highlightFill: "rgba(220,220,220,0.75)",
                highlightStroke: "rgba(220,220,220,1)",
                data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
            },
            {
                fillColor : "rgba(151,187,205,0.5)",
                strokeColor : "rgba(151,187,205,0.8)",
                highlightFill : "rgba(151,187,205,0.75)",
                highlightStroke : "rgba(151,187,205,1)",
                data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
            }
        ]

    }
    $().ready(function(){
        var ctx = $("#canv_orders").get(0).getContext("2d");
        new Chart(ctx).Bar(barChartData, {
            responsive : true
        });
    });

    /* 插件块关闭操作 */
    $(".title-opt .wm-slide").each(function(){
        $(this).click(function(){
            $(this).closest(".columns-mod").find(".bd").toggle();
            $(this).find("i").toggleClass("mod-up");
        });
    })
    $(function(){
        $('.sidebar').remove();
    })
</script>
</block>